<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
	    <meta name="viewport" content="width=device-width, initial-scale=1">
	    <link rel="stylesheet" type="text/css" href="/Public/Admin/lib/bootstrap/css/bootstrap.min.css"/>
	    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/base.css"/>
	    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/style.css"/>
		<script type="text/javascript" src="/Public/Admin/lib/bootstrap/js/jquery.min.js" ></script>
		<script type="text/javascript" src="/Public/Admin/lib/bootstrap/js/bootstrap.min.js" ></script>
		<script type="text/javascript" src="/Public/Admin/js/shacha.js" ></script>
	</head>
	<style>
	a:hover {   
 
		text-decoration: none;   
	}   
	</style>
	<body  style="background:transparent;" style="margin-top:30px;">
			
				<div class="pad-20" style="margin-top:-20px;">
				<div class="panel panel-default linear">
					<form class="form-horizontal m-t" id="commentForm" onsubmit="return checksubmit();" style="margin-left:29px;margin-top:30px;">
					<div class="form-group">
                                <label class="col-sm-1 control-label">收款银行账号：</label>
                                <div class="col-sm-3">
                                    <input id="bank_num" type="text" class="form-control" name="bank_num" value="<?=$set['bank_num']?>" required="" aria-required="true">
                                </div>	 
								
                      </div>
					  <div class="form-group">
                                
								<label class="col-sm-1 control-label" style="width:100px;">开户银行：</label>
                                <div class="col-sm-3">
                                    <input id="bank_name" type="text" class="form-control" name="bank_name" value="<?=$set['bank_name']?>" required="" aria-required="true">
                                </div>	 
                      </div>
					  
					  <div class="form-group">
                                <label class="col-sm-1 control-label" style="width:100px;">开户姓名：</label>
                                <div class="col-sm-3">
                                    <input id="bank_username" type="text" class="form-control" name="bank_username" value="<?=$set['bank_username']?>" required="" aria-required="true">
                                </div>	
															
                      </div>
					   <div class="form-group">
                               
								<label class="col-sm-1 control-label" style="width:100px;">支行信息：</label>
                                <div class="col-sm-3">
                                    <input id="bank_zhi" type="text" class="form-control" name="bank_zhi" value="<?=$set['bank_zhi']?>" required="" aria-required="true">
                                </div>									
                      </div>
							
                           
                          
							
						 
							 
							
							
                            <div class="form-group">
                                <div class="col-sm-4 col-sm-offset-1">
                                    <button class="btn btn-primary" type="submit">提交</button>
                                </div>
                            </div>
                        </form>
						<div class="row" style="
    margin-left: 12px;
    width: 100%;
">
            <div class="col-sm-12" >
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>银行信息</h5>
                    </div>
                    <div class="ibox-content">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>开户银行</th>
                                    <th>开户姓名</th>
                                    <th>收款银行账号</th>
									<th>支行信息</th>
									<th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
								<?php if ($set) { foreach ($set as $k=>$v) {?>
                                <tr>
                                    <td><?=$v['bank_name']?></td>
                                    <td><?=$v['bank_username']?></td>
									 <td><?=$v['bank_num']?></td>
									  <td><?=$v['bank_zhi']?></td>
                                    <td>
										<a href="/Admin/Index/bankset/gf/<?=$v['id']?>" class="btn btn-primary btn-xs btn-success" type="button" title="查看">查看</a>
										<a onclick="return del(<?=$v['id']?>);" class="btn btn-primary btn-xs btn-warning" type="button" title="删除">删除</a>
									</td>
                                </tr>
								<?php }}?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
			<div class="col-sm-6">
				<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
					<ul class="pagination">
						<?php echo ($page); ?>
					</ul>
				</div>
			</div>
        </div>
			</div>
			
	
	</body>
</html>
<link href="/Public/Admin/css/sweetalert/sweetalert.css" rel="stylesheet">
 <script src="/Public/Admin/js/sweetalert/sweetalert.min.js"></script>
 <script type="text/javascript" src="/Public/Admin/lib/bootstrap/js/jquery.min.js" ></script>
		<script type="text/javascript" src="/Public/Admin/lib/bootstrap/js/bootstrap.min.js" ></script>
		<script type="text/javascript" src="/Public/Admin/js/shacha.js" ></script>
 <script>
 function checksubmit() {
		var formParam = $("#commentForm").serialize();//序列化表格内容为字符串
		//var formParam = new FormData($('#commentForm')[0]);//序列化表格内容为字符串
		/* return false; */
		$.ajax({
			type:'post',      
			url:'/Admin/Index/bank_set',
			data:formParam,  
			cache:false,
			dataType:'json',  
			/*processData: false,  
            contentType: false,*/
			success:function(data){
				//alert(data.message);
				if (data.message == '配置成功') {
					swal("配置成功！", "", "success");
					
				} else {
					swal("配置失败！", "", "error");
				} 
			}
		});
		return false;
	}
 
	function del(id) {
	//alert(id);
		swal({
			title: "您确定要删除这条信息吗",
			text: "删除后将无法恢复，请谨慎操作！",
			type: "warning",
			showCancelButton: true,
			confirmButtonColor: "#DD6B55",
			confirmButtonText: "删除",
			closeOnConfirm: false
		}, function () {
			$.ajax({
				type:'post',      
				url:'/Admin/Index/del_bank',
				data:{id:id},  
				cache:false,
				dataType:'json',  
				success:function(data){
				//alert(data.message);
					if (data.message == '操作成功！') {
						swal(data.message, "", "success");
						window.location.reload();
					} else {
						swal(data.message, "", "error");
					}
				}
			});
			
		});
	}
 
 </script>